/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.teamreinforce.logic.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author tidiane
 */
@Entity
@Table(name = "reunion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reunion.findAll", query = "SELECT r FROM Reunion r"),
    @NamedQuery(name = "Reunion.findByIdReunion", query = "SELECT r FROM Reunion r WHERE r.idReunion = :idReunion"),
    @NamedQuery(name = "Reunion.findByTitre", query = "SELECT r FROM Reunion r WHERE r.titre = :titre"),
    @NamedQuery(name = "Reunion.findByDateReunion", query = "SELECT r FROM Reunion r WHERE r.dateReunion = :dateReunion"),
    @NamedQuery(name = "Reunion.findByHeureDebut", query = "SELECT r FROM Reunion r WHERE r.heureDebut = :heureDebut"),
    @NamedQuery(name = "Reunion.findByHeureFin", query = "SELECT r FROM Reunion r WHERE r.heureFin = :heureFin"),
    @NamedQuery(name = "Reunion.findBySalleReunion", query = "SELECT r FROM Reunion r WHERE r.salleReunion = :salleReunion"),
    @NamedQuery(name = "Reunion.findByCompteRendu", query = "SELECT r FROM Reunion r WHERE r.compteRendu = :compteRendu")})
public class Reunion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_reunion")
    private Integer idReunion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "titre")
    private String titre;
    @Lob
    @Size(max = 65535)
    @Column(name = "description")
    private String description;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "date_reunion")
    private String dateReunion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "heure_debut")
    private String heureDebut;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "heure_fin")
    private String heureFin;
    @Size(max = 255)
    @Column(name = "salle_reunion")
    private String salleReunion;
    @Size(max = 100)
    @Column(name = "compte_rendu")
    private String compteRendu;
    @ManyToMany(mappedBy = "reunionList")
    private List<Collaborateur> collaborateurList;
    @JoinColumn(name = "projet", referencedColumnName = "id_projet")
    @ManyToOne(optional = false)
    private Projet projet;

    public Reunion() {
    }

    public Reunion(Integer idReunion) {
        this.idReunion = idReunion;
    }

    public Reunion(Integer idReunion, String titre, String dateReunion, String heureDebut, String heureFin) {
        this.idReunion = idReunion;
        this.titre = titre;
        this.dateReunion = dateReunion;
        this.heureDebut = heureDebut;
        this.heureFin = heureFin;
    }

    public Integer getIdReunion() {
        return idReunion;
    }

    public void setIdReunion(Integer idReunion) {
        this.idReunion = idReunion;
    }

    public String getTitre() {
        return titre;
    }

    public void setTitre(String titre) {
        this.titre = titre;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDateReunion() {
        return dateReunion;
    }

    public void setDateReunion(String dateReunion) {
        this.dateReunion = dateReunion;
    }

    public String getHeureDebut() {
        return heureDebut;
    }

    public void setHeureDebut(String heureDebut) {
        this.heureDebut = heureDebut;
    }

    public String getHeureFin() {
        return heureFin;
    }

    public void setHeureFin(String heureFin) {
        this.heureFin = heureFin;
    }

    public String getSalleReunion() {
        return salleReunion;
    }

    public void setSalleReunion(String salleReunion) {
        this.salleReunion = salleReunion;
    }

    public String getCompteRendu() {
        return compteRendu;
    }

    public void setCompteRendu(String compteRendu) {
        this.compteRendu = compteRendu;
    }

    @XmlTransient
    public List<Collaborateur> getCollaborateurList() {
        return collaborateurList;
    }

    public void setCollaborateurList(List<Collaborateur> collaborateurList) {
        this.collaborateurList = collaborateurList;
    }

    public Projet getProjet() {
        return projet;
    }

    public void setProjet(Projet projet) {
        this.projet = projet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idReunion != null ? idReunion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reunion)) {
            return false;
        }
        Reunion other = (Reunion) object;
        if ((this.idReunion == null && other.idReunion != null) || (this.idReunion != null && !this.idReunion.equals(other.idReunion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.teamreinforce.logic.entities.Reunion[ idReunion=" + idReunion + " ]";
    }
    
}
